function noticia(message, type) {
    //Valores padrão
	height = typeof height !== 'undefined' ? height : 40;
    duration = typeof duration !== 'undefined' ? duration : 1000;
    if (type == 'sucesso') {
    	bgColor = "#b6d3a9";
        txtColor = "#66AA4B";
    } else if (type == 'falha') {
    	bgColor = "#f9caca";
        txtColor = "#EF3B3B";
    } else if (type == 'alerta') {
    	bgColor = "#fff8bf";
        txtColor = "#c4b421";
    } else {
	    bgColor = "#FF8B23";
	    txtColor = "#FFF";
    }
    
    /*create the notification bar div if it doesn't exist*/
    if ($('#notification-bar').size() == 0) {
        var HTMLmessage = "<div class='notification-message' style='text-align:center; line-height: " + height + "px;'> " + message + " </div>";
        $('body').prepend("<div id='notification-bar' style='display:none; width:100%; height:" + height + "px; background-color: " + bgColor + "; position: fixed; z-index: 100; color: " + txtColor + ";border-top: 1px solid " + txtColor + "; border-bottom: 1px solid " + txtColor + ";'>" + HTMLmessage + "</div>");
    }
    /*Animação*/
    $('#notification-bar').slideDown(function() {
        setTimeout(function() {
            $('#notification-bar').slideUp(function() {});
        }, duration);
    });
}

function confirma() {
	if (confirm('Tem certeza que deseja excluir?')) {
		return true;
	} else {
		return false;
	}
}

function somar(id) {
	qtde = $('#' + id).val();
	if (parseInt(qtde) < 20) {
		qtde = parseInt(qtde) + 1;
		$('#' + id).val(qtde);
	}
}

function subtrair(id) {
	qtde = $('#' + id).val();
	qtde = parseInt(qtde);
	if (qtde > 1) {
		qtde = qtde - 1;
		$('#' + id).val(qtde);
	}
}